/****

    activequant - activestocks.eu

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

	
	contact  : contact@activestocks.eu
    homepage : http://www.activestocks.eu

****/
package org.activequant.math.regression;

/**
 * Holds the following associated variables:
 * <ul>
 * <li>isAxisTranslation(boolean)</li>
 * <li>name(String)</li>
 * <li>value(double)</li>
 * <li>variation(double)</li>
 * <li>error(double)</li>
 * </ul>
 * <b>History:</b><br>
 *  - [31.05.2006] Created (Erik Nijkamp)<br>
 *
 *  @author Erik Nijkamp
 */
public class Coefficient {
	/**
	 * private double value = 0.0f;
	 */
	private double value = 0.0f;
	/**
	 * private double error = 0.0f;
	 */
	private double error = 0.0f;
	/**
	 * private double variation = 0.0f;
	 */
	private double variation = 0.0f;
	/**
	 * private String name = null;
	 */
	private String name = null;
	/**
	 * private boolean isAxisTranslation = false;
	 */
	private boolean isAxisTranslation = false;
	/**
	 * constructs a Coefficient using the given isAxisTranslation(boolean), name(String), value(double), var(double) and err(double) to set its
	 * associated isAxisTranslation(boolean), name(String), value(double), variation(double) and error(double)
	 * @param isAxisTranslation
	 * @param name
	 * @param value
	 * @param var
	 * @param err
	 */
	public Coefficient(boolean isAxisTranslation, String name, double value, double var, double err) {
		this.isAxisTranslation = isAxisTranslation;
		this.name = name;
		this.value = value;
		this.variation = var;
		this.error = err;
	}
	/**
	 * returns the associated name(String)
	 * @return
	 */
	public String getName() {
		return name;
	}
	/**
	 * returns the associated value(double)
	 * @return
	 */
	public double getValue() {
		return value;
	}
	/**
	 * returns the associated variation(double)
	 * @return
	 */
	public double getVariation() {
		return variation;
	}
	/**
	 * returns the associated error(double)
	 * @return
	 */
	public double getError() {
		return error;
	}
	/**
	 * returns <strong>${value}/${error}</strong> using the associated value(double) and error(double)
	 * @return
	 */
	public double getTStat() {
		return getValue()/getError();
	}

	/**
	 * returns the associated isAxisTranslation(boolean)
	 * @return the isAxisTranslation
	 */
	public boolean isAxisTranslation() {
		return isAxisTranslation;
	}
	

}
